<?php
/**
 * Created by PhpStorm.
 * User: bzing
 * Date: 2017/7/27 0027
 * Time: 下午 2:53
 */
namespace app\api\controller;
use app\models\Models;

class Account extends Base{
    /**
     * 我的账户
     * @return \think\response\Json
     */
    public function accountInfo(){
        if(request()->isPost()){
            try{
                $params = self::checkLogin(['equipment','encrypt']);
                $account = new Models('account');
                $info = $account->_find(['uid'=>$params['uid']],'coin_income,coin_balance,balance,amount');
            } catch (\Exception $e){
                return json(self::formatResult($e->getCode(),$e->getMessage()));
            }
            return json(self::formatSuccessResult($info));
        }
    }
}